package com.wiserp.rest.resource;

import java.util.List;

import org.restlet.resource.Get;
import org.restlet.resource.ResourceException;
import org.restlet.resource.ServerResource;

import com.wiserp.rest.helper.WhLocProdHelper;
import com.wiserp.rest.model.WhLocProd;

public class WhLocResource extends ServerResource{
	private WhLocProdHelper whLocProdHelper;
	private String whLocNo;
    protected void doInit() throws ResourceException {
    	Object whLocNoParam = getRequestAttributes().get("whLocNo");
    	if(whLocNoParam!=null)
    		whLocNo = (String)whLocNoParam;	
	}
    
    @Get
    public List<WhLocProd> getStock(){
    	return whLocProdHelper.findStockByWhLoc(whLocNo);
    }

	public void setHelper(WhLocProdHelper whLocProdHelper) {
		this.whLocProdHelper = whLocProdHelper;
	}

}
